import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.geom.*;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JLabel;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import javax.swing.JPanel;
import java.awt.Font;
import javax.swing.JPanel;

public class MyPanel2 extends JPanel {
	
	//WYPISANIE TEKSTU 
	 public void paintComponent(Graphics g)
     {
     	g.drawString("PODAJ LICZBĘ GRACZY", MESSAGE_X, MESSAGE_Y);
     	g.drawString("PODAJ LICZBĘ BOTÓW", MESSAGE_W, MESSAGE_Z);
     }
	 public static final int MESSAGE_X = 75;
	 public static final int MESSAGE_Y = 100;
	 public static final int MESSAGE_W = 75;
	 public static final int MESSAGE_Z = 200;
	 
        private Guzik dalej;

        public MyPanel2() {

                setPreferredSize(new Dimension(790, 500));
                setBackground(new Color(46, 139, 87));

                add(new JLabel("podaj ilosc graczy\n"));
             // wybieranie ilosci ludzi
                JComboBox ludzie = new JComboBox();
                ludzie.setEditable(true);
                ludzie.addItem("1");
                ludzie.addItem("2");
                ludzie.addItem("3");
                ludzie.addItem("4");
                
                add(new JLabel("podaj ilosc botów\n"));
             // wybieranie ilosci graczy
                JComboBox boty = new JComboBox();
                boty.setEditable(true);
                boty.addItem("1");
                boty.addItem("2");
                boty.addItem("3");
                boty.addItem("4");
               
                
                dalej = new Guzik();

               
                

                // dodanie tych 'wybieraczy'
                JPanel comboPanel = new JPanel();
                comboPanel.add(ludzie);
                // comboPanel.setLocation(300,200);
                add(comboPanel);

                comboPanel.setLocation(200, 300);
                JPanel comboPanel2 = new JPanel();
                comboPanel2.add(boty);
                add(comboPanel2);

                add(dalej);

        }

        class Guzik extends JButton implements ActionListener {

                Guzik() {
                        super("Dalej");
                        addActionListener(this);
                }

                @Override
                public void actionPerformed(ActionEvent e) {
                        // tutaj przechodzenie do nastepnego etapu
                }
        }

}